<%
/**
 *  list 系统操作列表
 * 
 * @author  李荣华
 * @version v1.0
 * @date    2017-09-17
 * @since   JSP 2.3.1
 */
%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="at" uri="http://www.jketing.com/at"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>操作列表</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta content="no-cache" http-equiv="Pragma"/>
		<meta content="no-cache" http-equiv="Cache-Control"/>
		<meta content="0" http-equiv="Expires"/>
		<meta name="GENERATOR" content="MSHTML 8.00.6001.18854"/>
		<link rel="stylesheet" id="list" type="text/css" href="<at:url css="list.css"/>" />
		<link rel="stylesheet" type="text/css" id="banner" href="<at:url css="banner_button.css"/>" />	
		<script type="text/javascript" src="${pageContext.request.contextPath }/scripts/jquery.js"></script>	
		<script type="text/javascript" src="${pageContext.request.contextPath }/scripts/common.js"></script>
		<script type="text/javascript" src="<at:url js="list.js"/>"></script>	
		<script type="text/javascript">
			/**
			 * 跳转到添加页面
			 */
			function add(){
				setTimeout(function(){
				    window.location.href = "${pageContext.request.contextPath }/operation";
				},0);
			}
			
			/**
			 * 跳转到编辑页面
			 */
			function edit(){
				var id = checkOneValue('checkOne');
				if(id){
					var url = "${pageContext.request.contextPath}/operation/" + id;
					$("#_form").attr("action", url);
					$("#_form").submit();
				}
			}
			
			/**
			 * 点击名称跳转编辑页
			 */
			function enter(id){
				var url = "${pageContext.request.contextPath}/operation/" + id;
				$("#_form").attr("action", url);
				$("#_form").submit();
			}
			
			/**
			 * 删除操作
			 */
			function del(){
				var ids = checkManyValue('checkOne');
				if(ids && window.confirm("你确定要删除吗？")){
					var url = "${pageContext.request.contextPath }/operation/" + ids;
					$("#_form").attr("action", url);
					$("#_method").val("DELETE");
					$("#_form").submit();
				}
			}
			
			/**
			 * 数据列表上的查询按钮调用
			 * 
			 * @return
			 */
			function queryBar() {	
				var bar = document.getElementById("query_bar");
				var header = document.getElementById("dataheader");
				var list = document.getElementById("dataList");
				if (bar.style.display == "none") {
					bar.style.display = "block";
					bar.style.top="52px";
					bar.style.height="30px";
					header.style.top="82px";
					list.style.top="106px";
					$("#vQuery").val("1");
				} else {
					bar.style.display = "none";				
					bar.style.top="0px";
					bar.style.height="0px";	
					header.style.top="52px";
					list.style.top="76px";
				}	
			}
			
			/**
			 * 数据列表上的查询按钮调用
			 * 
			 * @return
			 */
			function query() {
				$("#page").val("1");
				$("#_form").submit();
			}
			
			/**
			 * 页面初始化
			 */
			$(document).ready(function(){
				if(${vQuery}==1){
					var bar = document.getElementById("query_bar");
					var header = document.getElementById("dataheader");
					var list = document.getElementById("dataList");
					bar.style.display = "block";
					bar.style.top="52px";
					bar.style.height="30px";
					header.style.top="82px";
					list.style.top="106px";
				}
			});		
		</script>
	</head>
	<body>
		<form action="" id="_form" name="queryForm" method="POST" >
			<input type="hidden" id="_method" name="_method"/>
			<input type="hidden" id="page" name="page" value="${page}" />
			<input type="hidden" id= "order" name="order" value="${order}" />
			<input type="hidden" id="vQuery" name="vQuery" value="${vQuery}" />
			<!-- 位置 -->
			<div style="margin-left: 10px;margin-top: 10px">当前位置：<a href="#">系统配置</a>-&gt;<font color="#ff0000">系统操作</font></div>		 			
			<!-- 表头 -->
			<div class="list1">
				<!-- 按钮行表单 -->
   				<table width="100%" border="0" cellspacing="0" cellpadding="0">
      				<tr>
						<td width="5" height="24" id="kjz03"></td>
		    			<td class="biao1_zhong">
			            	<table width="100%" border="0" cellspacing="0" cellpadding="0">
			              		<tr>
			               			<td height="24">
				                		<jsp:include page="../../ListHead.jsp" flush="true">
			                				<jsp:param name="delUrl" value="${pageContext.request.contextPath }/operation/" />
			                			</jsp:include> 
									</td>
			              		</tr>
			            	</table>
		    			</td>
			    		<td width="5" height="24" id="kjy03"></td>
      				</tr>
    			</table>  		
			</div>
			<!-- 查询条件（默认不显示） -->
			<div id="query_bar" style="display:${vQuery=='0'?'none':'block'};" class="queryTab">
				<div>按纽名称:<input type="text" name="name" value="${query.name}" /></div>
				<div>按纽方法:<input type="text" name="methodName" value="${query.methodName}"/></div>
				<div>按纽备注:<input type="text" name="remark" value="${query.remark}"/></div>
				<div>
					<ul>
						<li class="biao5_zhong">
							<a href="#" onclick="query();">提交</a>
						</li>
					</ul>
				</div>
			</div> 	
			<div class="line_left"></div>
			<!-- 标题 -->
			<div id="dataheader" class="list2">
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
	              <tr class="cur">
	                <td width="4%" align="center"><input type='checkbox' onclick="selectReverse('checkOne')" id="ID" value=''/></td>
	                <td width="10%" align="left" style="cursor: pointer" onclick="orderby('name')">操作名称</td>
	                <td width="10%" align="left" style="cursor: pointer" onclick="orderby('stamp')">操作标记</td>
	                <td width="10%" align="left" style="cursor: pointer" onclick="orderby('url')">操作链接</td>
	                <td width="15%" align="left" style="cursor: pointer" onclick="orderby('methodName')">操作方法</td>
	                <td width="15%" align="left" style="cursor: pointer" onclick="orderby('iconName')">图标名称</td>
	                <td width="15%" align="left" style="cursor: pointer" onclick="orderby('orderNumber')">顺序号</td>									                
	                <td width="17%" align="left" style="cursor: pointer" onclick="orderby('remark')">备注</td>               
	              </tr>
		        </table>
			</div>	      					
			<!-- 内容 -->
			<div id="dataList" class="list3">
				<c:forEach items="${pageBean.content}" var="item" varStatus="status">
					<table  width="100%" border="0" cellspacing="0" cellpadding="0">
       					<tr id="tr${status.count}" onclick="rowclick(this)">																	
							<td>
								<table width="100%" border="0" cellspacing="0" cellpadding="0">
             					    <tr>
										<td width="4%" height="23" align="center">
											<input id="checkOne" name="checkOne" value="${item.id}" 
											type='checkbox' onclick="dataPageCheckChange(this)"/>
										</td>
										<td width="10%" align="left" onclick="enter('${item.id}');">${item.name}</td>
										<td width="10%" align="left">${item.stamp}</td>
										<td width="10%" align="left">${item.url}</td>
										<td width="15%" align="left">${item.methodName}</td>
										<td width="15%" align="left">${item.iconName}</td>
										<td width="15%" align="left">${item.orderNumber}</td>
										<td width="17%" align="left">${item.remark}</td>																		
									</tr>
					            </table>
					         </td>												        
					    </tr>
					</table>
				</c:forEach>
	    	</div>
	    	<div class="line_rigth"></div>	        			
			<div class="list4">
			<!-- 页码 -->
		      	<table width="100%" border="0" cellspacing="0" cellpadding="0">
			          <tr valign="top">
			            <td width="4" height="24" id="kj2z03"></td>
			             <td class="biao4_zhong">
				            <table width="100%" border="0" cellspacing="0" cellpadding="0">
				              <tr>									                
				                <td>
					                <table align="right">
					                  <tr>										                  
					                  	<at:page />										                  									                     
					                  </tr>
					                </table>
				                </td>									                
				              </tr>
				            </table>
			            </td>
			            <td width="4" height="24" id="kj2y03"></td>
			        </tr>
	        	</table>
			</div>
		</form>
	</body>
</html>
